package com.wade.demo.springbootnutz.domain.entity;

import java.io.Serializable;

import javax.validation.constraints.Size;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Table;

import lombok.Data;

/**
 *
 * @company: creekspring
 * @author wdChen
 * @date:2017-09-15 13:56:15
 * @Description:
 */
@Data
@Table("user")
public class User implements Serializable {
  private static final long serialVersionUID = 1L;

  /**
   * 登录用户名
   */
  @Column("username")
  @Size(max = 32)
  private String username;

  @Column("password")
  @Size(max = 64)
  private String password;

  @Column("salt")
  @Size(max = 32)
  private String salt;

  /**
   * 昵称
   */
  @Column("nickname")
  @Size(max = 32)
  private String nickname;

  @Column("phone")
  @Size(max = 32)
  private String phone;

  @Column("email")
  @Size(max = 64)
  private String email;

  @Column("wechat")
  @Size(max = 32)
  private String wechat;

  @Column("qq")
  @Size(max = 60)
  private String qq;

  /**
   * 密码是否处于重置状态。如果是，用户需要重新设定一次密码
   */
  @Column("password_reseted")
  private Integer passwordReseted;

  /**
   * 密码最后重置时间
   */
  @Column("password_reseted_at")
  private Long passwordResetedAt;

  /**
   * 密码最后一次手动更新时间。可以和重置时间比较判断是否需要重新手动设置
   */
  @Column("password_updated_at")
  private Long passwordUpdatedAt;

  /**
   * 是否锁定 1-是 0-否
   */
  @Column("locked")
  private Integer locked;

  /**
   * 是否为超级管理员
   */
  @Column("super_admin")
  private Integer superAdmin;

  @Column("remark")
  private String remark;

  @Column("created_at")
  private Long createdAt;

  @Column("created_by")
  @Size(max = 32)
  private String createdBy;

  @Column("updated_at")
  private Long updatedAt;

  @Column("updated_by")
  @Size(max = 32)
  private String updatedBy;

  @Column("deleted_at")
  private Long deletedAt;

  @Column("deleted_by")
  @Size(max = 32)
  private String deletedBy;

  public static class Field {
    public static final String ID = "id";

    public static final String USERNAME = "username";

    public static final String PASSWORD = "password";

    public static final String SALT = "salt";

    public static final String NICKNAME = "nickname";

    public static final String PHONE = "phone";

    public static final String EMAIL = "email";

    public static final String WECHAT = "wechat";

    public static final String QQ = "qq";

    public static final String PASSWORD_RESETED = "passwordReseted";

    public static final String PASSWORD_RESETED_AT = "passwordResetedAt";

    public static final String PASSWORD_UPDATED_AT = "passwordUpdatedAt";

    public static final String LOCKED = "locked";

    public static final String SUPER_ADMIN = "superAdmin";

    public static final String REMARK = "remark";

    public static final String CREATED_AT = "createdAt";

    public static final String CREATED_BY = "createdBy";

    public static final String UPDATED_AT = "updatedAt";

    public static final String UPDATED_BY = "updatedBy";

    public static final String DELETED_AT = "deletedAt";

    public static final String DELETED_BY = "deletedBy";

    private Field() {}
  }
}
